
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
html {
	height: 100%;
}

body {
	background-image: url("image3/12.jpg");
	background-size: 100%;
	height: 750px;
	background-repeat: no-repeat;
	overflow: hidden;
}

.snow {
	width: 50px;
	height: 50px;
	background-image: url("image3/3.jpg");
	position: absolute;
	background-repeat: no-repeat;
	overflow: hidden;
	background-size: 100%;
}
</style>
</head>
<body>
	<script type="text/javascript">
	//setTimeout() 就循环一次 定时器
	//setInterval()多次循环
		var windowWidth = window.screen.width;
		var windowHeight = window.screen.height;
		function createRound() {
			var div = document.createElement('div');
			div.className='snow';
		    div.transform='scale('+(Math.random())+')';
		    div.style.left=windowWidth*Math.random()+'px';
			div.style.top=windowHeight*Math.random()+'px';
			document.body.appendChild(div);//
			var index=0;
			setInterval(()=>{
				div.style.left=parseInt(div.style.left)+index+'px';
				div.style.top=parseInt(div.style.top)+index+'px';
				index+=0.1;
				if (parseInt(div.style.left)>=windowWidth ||parseInt(div.style.top)>=windowWidth)
						{index=0;
				div.style.left=windowWidth*Math.random()+'px';
				div.style.top=windowHeight*Math.random()+'px';
			}
		},10);
			}
		for(var i=0; i<100;i++){
			 createRound();
		}
	</script>
</body>
</html>